<?php
include_once ("mysqllib.php");

class user {
	public function displayAllUsers() {
		$db = new mysqllib();

		$query = "SELECT *  FROM User";
		$result = mysql_query($query);
		echo '<table id="listUsers"> <tr><th>Users</th></tr>';
		while ($data = mysql_fetch_array($result)) {
			echo '<tr><td>';
			echo $data['userName'].'</td>';
			echo '<td id="button'.$data['idUser'].'"> <button onclick="changeBlockUser(' . $data['idUser'] .','.$data['blocked'] .')">';
			if (intval($data['blocked'])) {
				echo 'Unblock';
			} else {
				echo 'Block';
			}
			echo '</button></td></tr>';
		}
		echo '</table>';
	}

}
?>